﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Rose.Models;
using Rose.Helper;

namespace Rose.Controllers
{
    public class JsonController : Controller
    {
        //
        // GET: /Json/
        private   Database_RoseEntities db = new Database_RoseEntities();
        
        public ActionResult Index()
        {
            return View();
        }
       

        private ListHelpModel listhelpmodel = new ListHelpModel();
        
        public ActionResult Province()
        {
            return Json(listhelpmodel.GetProvinceList(), JsonRequestBehavior.AllowGet);
        }

        
        public ActionResult City(int provinceId)
        {
            return Json(listhelpmodel.GetCityList(provinceId), JsonRequestBehavior.AllowGet);
        }

        
        public ActionResult Town(int cityId)
        {
            return Json(listhelpmodel.GetCityList(cityId), JsonRequestBehavior.AllowGet);
        }

        
        public ActionResult Street(int townId)
        {
            return Json(listhelpmodel.GetCityList(townId), JsonRequestBehavior.AllowGet);
        }

        public ActionResult College(int schoolId)
        {
            return Json(listhelpmodel.GetCollege(schoolId), JsonRequestBehavior.AllowGet);
        }

        //public ActionResult Major(int schoolId, int collegeId)
        //{
        //    return Json(listhelpmodel.GetMojor(schoolId, collegeId), JsonRequestBehavior.AllowGet);
        //}

    }
}
